﻿using iot.models;
using iot.pages;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace iot.repository
{
    class IotDbContext : DbContext
    {
        public DbSet<Device>? devices { get; set; }

        public DbSet<DevciePointInfo>? devcie_point_infos { get; set; }

        protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        {
            //optionsBuilder.UseSqlServer("Server=localhost;Database=iot;User Id=sa;Password=123456;TrustServerCertificate=True;");
            optionsBuilder.UseSqlite("Data Source=iot.db"); // SQLite connection string

        }
    }
}
